package ui.textfield 
{
	import flash.display.Sprite;
	/**
	 * ...
	 * @author Roy
	 */
	public class GCStylizedText extends Sprite 
	{
		public static const STYLE_ONE:uint = 1;
		public static const STYLE_TWO:uint = 2;
		public static const STYLE_THREE:uint = 3;
		public static const STYLE_FOUR:uint = 4;
		public static const STYLE_NONE:uint = 0;
		public static const STYLE_NEW_TASKS:uint = 5;
	
		private static const TOP_PADDING:uint = 5;
		private var _textArea:GCTextField;
		
		public function GCStylizedText() 
		{
			_textArea = new GCTextField();
			_textArea.y = TOP_PADDING;
			this.addChild(_textArea);
			
		}
		
		public function setTextDimension(width:int, height:int):void
		{
			_textArea.setDimensions(width, height);
		}
		
		public function setTextStyle(type:uint):void
		{
			_textArea.setStyle(type);
		}
		
		public function setBgStyle(type:uint, width:uint, height:int, imageString:String = null):void
		{
			this.graphics.clear();
			switch(type)
			{
				case STYLE_NONE:
					break;
				case STYLE_ONE:
					this.graphics.lineStyle(5);
					this.graphics.beginFill(GCConstants.COLOR_TAN);
					this.graphics.drawRoundRect(0, 0, width, height, 50);
					this.graphics.endFill();
					break;
				case STYLE_TWO:
					this.graphics.lineStyle(5);
					this.graphics.beginFill(GCConstants.COLOR_BROWN);
					this.graphics.drawRoundRect(0, 0, width, height, 50);
					this.graphics.endFill();
					break;
				case STYLE_THREE:
					this.graphics.lineStyle(3);
					this.graphics.beginFill(GCConstants.COLOR_GRAY);
					this.graphics.drawRoundRect(0, 0, width, height, 50);
					this.graphics.endFill();
					break;
				case STYLE_FOUR:
					this.graphics.lineStyle(3);
					this.graphics.beginFill(GCConstants.COLOR_GRAY);
					this.graphics.drawRoundRect(0, 0, width, height, 0);
					this.graphics.endFill();
					break;
				case STYLE_NEW_TASKS:
					this.graphics.lineStyle(3);
					this.graphics.beginFill(GCConstants.COLOR_RED);
					this.graphics.drawRoundRect(0, 0, width, height, 5);
					this.graphics.endFill();
					this.alpha = 0.8;
					break;
			}
			setTextDimension(width, height);
		}
		
		public function set text(content:String):void
		{
			_textArea.text = content;
		}
		
		public function set topPadding(padding:int):void
		{
			_textArea.y = padding;
		}
	}

}